import QtQuick 2.15
import './controls'
import './main/mamager'
import './main/cashier'

Rectangle {
    id:mainView
//    Component.onCompleted: {
//        CGlobal.createObject(mainView,'qrc:/main/mamager/ManagerHomeView.qml')
//    }
    Component.onCompleted: {
        CGlobal.showMessage(window,ScannerHelper.initScanner())
    }

    Loader {
        id: managerViewLoader
        anchors.fill: parent
        active:UserHelper.userinfo.st_type === 0
        sourceComponent: ManagerHomeView {
        }
    }
    Loader {
        id: cashierViewLoader
        anchors.fill: parent
        active: UserHelper.userinfo.st_type === 1
        sourceComponent: CashierHomeView {
        }
    }

//    HomeView{
//        anchors.fill: parent
//    }
}
